package com.tledu.store.service.impl;

import com.tledu.common.utils.DateUtils;
import com.tledu.store.domain.StoreLog;
import com.tledu.store.domain.vo.StoreLogVO;
import com.tledu.store.mapper.StoreLogMapper;
import com.tledu.store.service.IStoreLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 库房日志Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-29
 */
@Service
public class StoreLogServiceImpl implements IStoreLogService 
{
    @Autowired
    private StoreLogMapper storeLogMapper;

    /**
     * 查询库房日志
     * 
     * @param id 库房日志主键
     * @return 库房日志
     */
    @Override
    public StoreLog selectStoreLogById(Long id)
    {
        return storeLogMapper.selectStoreLogById(id);
    }

    /**
     * 查询库房日志列表
     * 
     * @param storeLog 库房日志
     * @return 库房日志
     */
    @Override
    public List<StoreLogVO> selectStoreLogList(StoreLogVO storeLog)
    {
        return storeLogMapper.selectStoreLogList(storeLog);
    }

    /**
     * 新增库房日志
     * 
     * @param storeLog 库房日志
     * @return 结果
     */
    @Override
    public int insertStoreLog(StoreLog storeLog)
    {
        storeLog.setCreateTime(DateUtils.getNowDate());
        return storeLogMapper.insertStoreLog(storeLog);
    }

    /**
     * 修改库房日志
     * 
     * @param storeLog 库房日志
     * @return 结果
     */
    @Override
    public int updateStoreLog(StoreLog storeLog)
    {
        return storeLogMapper.updateStoreLog(storeLog);
    }

    /**
     * 批量删除库房日志
     * 
     * @param ids 需要删除的库房日志主键
     * @return 结果
     */
    @Override
    public int deleteStoreLogByIds(Long[] ids)
    {
        return storeLogMapper.deleteStoreLogByIds(ids);
    }

    @Override
    public List<StoreLog> selectStoreLogList1(StoreLogVO storeLogVO) {
        return storeLogMapper.selectStoreLogList1(storeLogVO);
    }

    /**
     * 删除库房日志信息
     * 
     * @param id 库房日志主键
     * @return 结果
     */
    @Override
    public int deleteStoreLogById(Long id)
    {
        return storeLogMapper.deleteStoreLogById(id);
    }

    //逻辑删除
    public int logicDeleteStoreLogByIds(Long[] ids) {
        return storeLogMapper.logicDeleteStoreLogByIds(ids);
    }
}
